import java.util.*;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 98152
 * Date: 2024-07-30
 * Time: 10:13
 */
public class Test {
    public static void main(String[] args) {
        Set<Integer> set = new TreeSet<>();
        set.add(4);
        set.add(7);
        set.add(1);
        set.add(3);
        System.out.println(set.size());
    }
    public static void main3(String[] args) {
        Set<Integer> set = new TreeSet<>();
        set.add(4);
        set.add(7);
        set.add(1);
        set.add(3);
        System.out.println(set);
        set.remove(4);
        System.out.println(set);
    }
    public static void main2(String[] args) {
        Set<Integer> set = new TreeSet<>();
        set.add(4);
        set.add(7);
        set.add(1);
        set.add(3);
        Iterator<Integer> it = set.iterator();
        while(it.hasNext()) {
            System.out.print(it.next()+" ");
        }
    }
    public static void main1(String[] args) {
        Map<String,Integer> map = new TreeMap<>();
        map.put("fbc",2);
        map.put("cde",3);
        map.put("abc",5);
        map.put("grh",8);
        // 打印所有的value
        Collection<Integer> collection = map.values();
        System.out.println(collection);
        for(Integer x: collection) {
            System.out.print(x + " ");
        }
    }
}
